import _ from 'lodash'

/* eslint-env node */
const files = (require as any).context('.', true, /index\.ts$/)
const modules: { [name: string]: any } = {}

files.keys().forEach((key: string) => {
  if (key === './index.ts') return
  const moduleName = _.camelCase(key.replace(/(\.\/|\/index\.ts)/g, ''))
  modules[moduleName] = files(key).default
})

export default modules